<template>
  <div>
    <van-nav-bar title="文章列表" left-arrow @click-left="onClickLeft" />
    <ul>
      <li>
        <p>{{ list.title }}</p>
        <img :src="list.pic" alt />
        <div v-html="list.content"></div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list:{},
      pid: 0,
    };
  },
  created() {},
  mounted() {
    this.pid = this.$route.params.id;
  
    this.wenlist();
  },
  methods: {
    wenlist() {
      this.$axios({
        url: "https://api.it120.cc/small4/cms/news/detail",
        methods: "post",
        params: {
          id: this.pid,
        },
      }).then((mgs) => {
        this.list = mgs.data;
        console.log(mgs);
        console.log(this.list);
      });
    },
    onClickLeft() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped lang="less">
li {
  font-size: 0.16rem;
}
</style>
